#ifndef _NE_GLUT_APPLICATION_H_
#define _NE_GLUT_APPLICATION_H_

#include <graphics/Engine.h>

#if NE_PLATFORM == NE_PLATFORM_MACOSX
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

namespace ne
{
    class NEAPI GlutApplication : public Singleton<GlutApplication>
    {
        public:
            GlutApplication();

            GlutApplication(int argc, char *argv[]);

            virtual ~GlutApplication();

        public:
            static bool InitializeGlut(int argc, char *argv[]);

            static void AtExit();

            // Callback Function for Glut
            static void ResizeWindow(int width, int height);

            static void MouseFunc(int button, int state, int x, int y);

            static void MouseMoveFunc(int x, int y);

            static void KeyboardDown(unsigned char key, int x, int y);

            static void KeyboardUp(unsigned char key, int x, int y);

            static void SpecialDown(int key, int x, int y);

            static void SpecialUp(int key, int x, int y);

            static KeyboardKey ConvertGlutSpecialKey(int key);

        public:
            static GlutApplication& GetSingleton();

            static GlutApplication* GetSingletonPtr();

        public:
            static Engine *engine;
    };
}

#endif
